<template>
  <div class="slot">
    <div class="day">
      <dl>
        <dd v-for="(item) in mainlist">
          <NuxtImg src="/img/task1.png" alt="" />
          <div>
            <p>
              {{ $t(item.text) }}
              <el-icon size="14" @click="visible = true">
                <QuestionFilled />
              </el-icon>
            </p>
            <div>
              <i>0</i>
              <i>/</i>
              <i>100</i>
            </div>
            <span>{{ $t("language.task.price") }}:{{ $t("language.task.money")
              }}{{ item.money }}</span>
          </div>
          <span>{{ $t("language.task.complete") }}</span>
        </dd>
      </dl>
    </div>
    <!--  :title="$t('language.task.dialogtitle')" -->
    <el-dialog v-model="visible" center :show-close="false" width="600px">
      <div class="taskdialog">
        <p>
          {{ $t("language.task.dialoguser") }}
        </p>
        <p>{{ $t("language.task.dialogtext1") }}</p>
        <p>{{ $t("language.task.dialogtext2") }}</p>
        <p>{{ $t("language.task.dialogtext3") }}</p>
        <p>{{ $t("language.task.dialogtext4") }}</p>
        <p>{{ $t("language.task.dialogtwo") }}</p>
        <p></p>
        <p>{{ $t("language.task.dialog1") }}</p>
        <p>{{ $t("language.task.dialog2") }}</p>
        <span @click="visible = false">{{ $t("language.task.tipsbtn") }}</span>
      </div>
      <template #header="{ close }">
        <div class="my-header">

          <h4>{{ $t("language.task.dialogtitle") }}</h4>
          <el-icon color="#fff" @click="close">
            <Close />
          </el-icon>
        </div>
      </template>
    </el-dialog>
  </div>

</template>

<script setup lang="ts">
import { ref, shallowRef, reactive } from "vue";
import { QuestionFilled, Close } from '@element-plus/icons-vue'
let activeindex = shallowRef<number>(0);

const visible = shallowRef<boolean>(false);
let mainlist = reactive([
  {
    date: "day1",
    text: "language.task.day1task1",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day1",
    text: "language.task.day1task2",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day1",
    text: "language.task.day1task3",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day1",
    text: "language.task.day1task4",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day2",
    text: "language.task.day2task1",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day2",
    text: "language.task.day2task2",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day2",
    text: "language.task.day2task3",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day2",
    text: "language.task.day2task4",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day3",
    text: "language.task.day3task1",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day3",
    text: "language.task.day3task2",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day3",
    text: "language.task.day3task3",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day3",
    text: "language.task.day3task4",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day4",
    text: "language.task.day4task1",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day4",
    text: "language.task.day4task2",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day4",
    text: "language.task.day4task3",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day4",
    text: "language.task.day4task4",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day5",
    text: "language.task.day5task1",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day5",
    text: "language.task.day5task2",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day5",
    text: "language.task.day5task3",
    money: "10.00",
    jf: "1000",
  },
  {
    date: "day5",
    text: "language.task.day5task4",
    money: "10.00",
    jf: "1000",
  },
]);
let dayt = shallowRef<string>("day1");
let list = reactive([]);
let chooseDate = (day: string, index: number) => {
  activeindex.value = index;
  dayt.value = day;
  // list = mainlist.filter((i) => i.date == dayt.value);
};
chooseDate(dayt.value, 0);
</script>

<style lang="scss">
.slot {
  .el-dialog__header {
    padding: 0;
  }

  .el-dialog__title {
    color: #fff !important;
    text-align: left !important;
  }

  .el-dialog {
    padding: 20px !important;
    background-color: rgb(49, 53, 62) !important;
    --el-dialog-bg-color: rgb(49, 53, 62) !important;
    border-radius: 15px;
  }
}
</style>
<style lang="scss" scoped>
.slot {
  width: 100%;
  padding: 0 10px;

  .day {
    width: 100%;
    border: solid 1px #4a4c53;
    padding: 10px 20px;
    border-radius: 15px;

    height: 69vh;
    overflow-y: scroll;

    &::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    dl {
      @include flex(column, center, center);

      dd {
        width: 100%;
        border-radius: 10px;
        padding: 10px;
        margin-bottom: 10px;
        background-color: rgb(36, 38, 43);
        @include flex(row, center, center);
        border: solid 1px #4a4c53;

        div {
          flex: 1;
        }

        img {
          width: 56px;
          margin-left: 20px;
        }

        >div {
          padding-left: 40px;
          margin-right: 10px;
          @include flex(column, center, flex-start);

          p {
            font-size: 16px;
            color: #95979e;
            line-height: 16px;
            position: relative;
            width: 100%;

            .el-icon {
              position: absolute;
              right: 0;
              top: 50%;
              margin-top: -7px;
              cursor: pointer;
            }
          }

          div {
            width: 100%;
            height: 20px;
            background-color: rgb(60, 64, 74);
            border-radius: 10px;
            @include flex(row, center, center);

            i {
              font-style: normal;
              color: #fff;
              font-size: 16px;
            }
          }

          span {
            color: #fff;
            font-size: 16px;
          }
        }

        >span {
          font-size: 20px;
          color: #0a906c;
          display: block;
          height: 42px;
          line-height: 42px;
          @include flex(row, center, center);
          border-radius: 10px;
          border: 1px solid #0a906c;
          width: 133px;
          cursor: pointer;
        }
      }
    }
  }
}

.my-header {
  @include flex(row, space-between, center);
  width: 100%;
  .el-icon {
    cursor: pointer;
  }


  h4 {
    color: #fff;
    font-size: 24px;
    font-weight: normal;
  }
}

.taskdialog {
  padding: 40px 10px 0 10px;

  p {
    color: #95979e;
    font-size: 14px;
    line-height: 22px;
  }

  span {
    background-color: #0a906c;
    width: 120px;
    display: block;
    margin: 30px auto 15px;

    color: #fff;
    border-radius: 20px;
    height: 40px;
    text-align: center;
    line-height: 40px;

  }
}
</style>